from soj.tests.common import Test
from pathlib import Path
from soj.builtin.compare.float.float import FloatCompare
from soj.builtin.compare.common import ResultCode

TEST=Path(__file__).parent.resolve()
TEST_A=TEST/"a.txt"
TEST_B=TEST/"b.txt"
TEST_C=TEST/"c.txt"

if __name__=="__main__":
    t=Test()

    fca=FloatCompare(TEST_A,TEST_B)
    fcb=FloatCompare(TEST_A,TEST_C)

    ra=fca.compare()
    rb=fcb.compare()

    t.ensure(ra["result_code"]==ResultCode.ACCEPTABLE)
    print("A ",ra)
    t.ensure(rb['result_code']==ResultCode.UNACCEPTABLE)
    print("B ",rb)
    t.print_report()